import request from '@/utils/request'

// get 获得优惠卡批次列表数据
export function getBatchList(params) {
  return request({
    url: '/ops/batch/list',
    method: 'get',
    params: { batchType: params }
  })
}

// get 获得优惠卡列表数据
export function getCouponList(data) {
  return request({
    url: '/ops/coupon/list',
    method: 'post',
    data
  })
}

// post 创建优惠卡数据
export function addNewPromcode(data) {
  return request({
    url: '/ops/batch/add',
    method: 'post',
    data: data
  })
}

// get 获得课程列表数据
export function getAllCourseList(params) {
  return request({
    url: '/ops/course/allList',
    method: 'get',
    params: { tenantId: params }
  })
}

// get 获得班级列表数据
export function getClassList(params) {
  return request({
    url: '/ops/classroom/list',
    method: 'get',
    params
  })
}

// get 获得会员列表数据
export function getMemberList(params) {
  return request({
    url: '/ops/member/list',
    method: 'get',
    params: { type: params }
  })
}

// get 获得优惠卡列表数据
export function getCouponListByBatchId(params) {
  return request({
    url: '/ops/coupon/getListByBatchId',
    method: 'get',
    params: { batchId: params }
  })
}

// get 删除优惠卡批次列表数据
export function deleteBatchCoupon(params, type) {
  return request({
    url: '/ops/batch/delete',
    method: 'get',
    params: { id: params, type: type }
  })
}
